using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Material;
using HengTong.Model;


namespace HengTong.ViewModel.SupplyChain.SysMaterialSkuVms
{
    public partial class SysMaterialSkuTemplateVm : BaseTemplateVM
    {
        [Display(Name = "名称")]
        public ExcelPropety NameExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.Name);
        [Display(Name = "编码")]
        public ExcelPropety CodeExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.Code);
        [Display(Name = "ERP系统ID")]
        public ExcelPropety ErpIdExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.ErpId);
        [Display(Name = "详情")]
        public ExcelPropety DescriptionExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.Description);
        [Display(Name = "状态")]
        public ExcelPropety StateExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.State);
        [Display(Name = "条形码")]
        public ExcelPropety BarCodeExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.BarCode);
        [Display(Name = "含税单价")]
        public ExcelPropety TaxPriceExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.TaxPrice);
        [Display(Name = "单价")]
        public ExcelPropety PriceExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.Price);
        [Display(Name = "最近入库时间")]
        public ExcelPropety LastInStockTimeExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.LastInStockTime);
        [Display(Name = "计量单位")]
        public ExcelPropety UnitExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.UnitId);
        [Display(Name = "物料")]
        public ExcelPropety MaterialExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.MaterialId);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysMaterialSku>(x => x.Remark);

	    protected override void InitVM()
        {
            UnitExcel.DataType = ColumnDataType.ComboBox;
            UnitExcel.ListItems = DC.Set<SysMeasureUnit>().GetSelectListItems(Wtm, y => y.Name);
            MaterialExcel.DataType = ColumnDataType.ComboBox;
            MaterialExcel.ListItems = DC.Set<SysMaterial>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysMaterialSkuImportVm : BaseImportVM<SysMaterialSkuTemplateVm, SysMaterialSku>
    {

    }

}
